<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>登入 - </title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/admin/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/admin/layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" href="/admin/layuiadmin/style/login.css" media="all">
    <link rel="stylesheet" href="/admin/css/u-ui.css" media="all">
</head>
<style>
    body{
        width: 100%;
        height: 100%;
        background: #68C2FB;
        font-size: 16px;
    }
    .quan0 {
        width: 10vw;
        height: 10vw;
        border-radius: 50%;
        background-color: #85CEFB;
    }
    .quan1 {
        width: 30vw;
        height: 30vw;
        border-radius: 50%;
        background-color: #ffffff;
        opacity: 0.1;
    }
    .quan2{
        width: 50vw;
        height: 50vw;
        border-radius: 50%;
        background-color: #68C2FB;
    }
    .quan3{
        width: 70vw;
        height: 70vw;
        border-radius: 50%;
        background-color: #57BBFA;
    }
    .quan4{
        width: 90vw;
        height: 90vw;
        border-radius: 50%;
        background-color: #2FAAF8;
        margin: auto;
        margin-top: -20vw;
    }
</style>
<body>

<div class="u-flex u-row-center u-col-center u-rela" style="overflow:hidden;width: 100vw;height: 100vh;">
<!--    <view class="quan4 u-flex u-row-center u-col-center">-->
<!--        <view class="quan3 u-flex u-row-center u-col-center">-->
<!--            <view class="quan2 u-flex u-row-center u-col-center">-->
<!--                <view class="quan1 u-flex u-row-center u-col-center">-->
<!--                    <view class="quan0">-->

<!--                    </view>-->
<!--                </view>-->
<!--            </view>-->
<!--        </view>-->
<!--    </view>-->
    <div class="u-bg-white u-abso" style="border-radius: 20px;">
        <div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login" style="display: none;padding: 10px 20px 20px 20px;">
            <div class="layadmin-user-login-main">
                <div class="layadmin-user-login-box layadmin-user-login-header">
<!--                    <h2>{:config('-appsite.app_name')}</h2>-->
                    <p style="font-size: 32px;font-weight: bold;color:#333333;">欢迎登录商家管理系统</p>
                </div>
                <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
                    <div class="layui-form-item">
                        <label class="layadmin-user-login-icon layui-icon layui-icon-username" for="LAY-user-login-username"></label>
                        <input type="text" name="username" id="LAY-user-login-username" lay-verify="required" placeholder="用户名" class="layui-input">
                    </div>
                    <div class="layui-form-item">
                        <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="LAY-user-login-password"></label>
                        <input type="password" name="password" id="LAY-user-login-password" autocomplete="off" lay-verify="required" placeholder="密码" class="layui-input">
                    </div>
                    {if $yan==1}
                    <div class="layui-form-item">
                        <div class="layui-row">
                            <div class="layui-col-xs7">
                                <label class="layadmin-user-login-icon layui-icon layui-icon-vercode" for="LAY-user-login-vercode"></label>
                                <input type="text" name="vercode" id="LAY-user-login-vercode" lay-verify="required" placeholder="图形验证码" class="layui-input">
                            </div>
                            <div class="layui-col-xs5">
                                <div style="margin-left: 10px;">
                                    <img src="/admin/Login/verify" class="layadmin-user-login-codeimg" id="verifyImg" onclick="fleshVerify()">
                                </div>
                            </div>
                        </div>
                    </div>
                    {/if}
                    <div class="layui-form-item" style="margin-bottom: 20px;">
                        <input type="checkbox" name="remember" lay-skin="primary" title="记住帐号">
                        <a href="javascript:void(0);" onclick="layer.msg('忘记密码只能找管理员重置');" class="layadmin-user-jump-change layadmin-link" style="margin-top: 7px;">忘记密码？</a>
                    </div>
                    <div class="layui-form-item">
                        <button class="layui-btn layui-btn-fluid" lay-submit lay-filter="LAY-user-login-submit" style="height: 45px;background: #0464F2;">登录</button>
                    </div>
                </div>
            </div>

<!--            <div class="layui-trans layadmin-user-login-footer">-->

<!--                <p>{:config('-appsite.app_company')}</p>-->
<!--                <p>-->
<!--                    备案号:{:config('-appsite.web_keep')}-->
<!--                </p>-->
<!--            </div>-->

        </div>
    </div>
</div>



<script src="/admin/js/jquery.js"></script>
<script src="/admin/layuiadmin/layui/layui.js"></script>
<script>function fleshVerify(){document.getElementById('verifyImg').src= "/admin/Login/verify?id="+Math.random();}</script>
<script>
    layui.config({
        base: '/admin/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'useradmin'], function(){
        var $ = layui.$,form = layui.form;

        //提交
        form.on('submit(LAY-user-login-submit)', function(obj){
            var res=obj.field;
            $.post(
                "/admin/Login/merlogin",
                res,
                function(data,state){
                    if(state != "success"){
                        layer.msg("请求出错!");
                        fleshVerify();
                    }else if(data.status == 1){
                        layer.msg('登录成功');
                        setTimeout(function(){
                            window.location.href = "/admin/Index/index";
                        },500);
                    }else{
                        layer.msg(data.msg);
                        setTimeout(function(){
                            window.location.href = data.url;
                        },500);
                    }
                }
            );
        });

    });
</script>
</body>
</html>